From: Stefan Kleeschulte Date: Fri, 17 Jan 2025 12:42:34 +0000 (+0100) Subject: luci-mod-status: consider family when rendering chains and rules X-Git-Url: http://git.openwrt.org/%22https:/collectd.org/%22http:/www.crowdsec.net//%22https%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22https%22?a=commitdiff_plain;h=e79e7022e50bd1782a528f8c8ddd16f340fbce35;p=project%2Fluci.git luci-mod-status: consider family when rendering chains and rules There can be multiple tables with the same name but different family attribute (inet, ip, ip6, ...). The same goes for chains. So the family attribute needs to be considered when rendering chains and rules. Signed-off-by: Stefan Kleeschulte --- diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js index 406f134327..0013a3a116 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/nftables.js @@ -607,7 +607,7 @@ return view.extend({ ])); for (var i = 0; i < data.length; i++) - if (typeof(data[i].rule) == 'object' && data[i].rule.table == spec.table && data[i].rule.chain == spec.name) + if (typeof(data[i].rule) == 'object' && data[i].rule.table == spec.table && data[i].rule.chain == spec.name && data[i].rule.family == spec.family) node.lastElementChild.appendChild(this.renderRule(data, data[i].rule)); if (node.lastElementChild.childNodes.length == 1) @@ -669,7 +669,7 @@ return view.extend({ ]); for (var i = 0; i < data.length; i++) - if (typeof(data[i].chain) == 'object' && data[i].chain.table == spec.name) + if (typeof(data[i].chain) == 'object' && data[i].chain.table == spec.name && data[i].chain.family == spec.family) node.lastElementChild.lastElementChild.appendChild(this.renderChain(data, data[i].chain)); return node;